<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Jetson Inference: jetson-inference/superResNet.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="NVLogo_2D.jpg"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Jetson Inference
   </div>
   <div id="projectbrief">DNN Vision Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('superResNet_8h_source.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">superResNet.h</div>  </div>
</div><!--header-->
<div class="contents">
<a href="superResNet_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno">    2</span>&#160;<span class="comment"> * Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.</span></div><div class="line"><a name="l00003"></a><span class="lineno">    3</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00004"></a><span class="lineno">    4</span>&#160;<span class="comment"> * Permission is hereby granted, free of charge, to any person obtaining a</span></div><div class="line"><a name="l00005"></a><span class="lineno">    5</span>&#160;<span class="comment"> * copy of this software and associated documentation files (the &quot;Software&quot;),</span></div><div class="line"><a name="l00006"></a><span class="lineno">    6</span>&#160;<span class="comment"> * to deal in the Software without restriction, including without limitation</span></div><div class="line"><a name="l00007"></a><span class="lineno">    7</span>&#160;<span class="comment"> * the rights to use, copy, modify, merge, publish, distribute, sublicense,</span></div><div class="line"><a name="l00008"></a><span class="lineno">    8</span>&#160;<span class="comment"> * and/or sell copies of the Software, and to permit persons to whom the</span></div><div class="line"><a name="l00009"></a><span class="lineno">    9</span>&#160;<span class="comment"> * Software is furnished to do so, subject to the following conditions:</span></div><div class="line"><a name="l00010"></a><span class="lineno">   10</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00011"></a><span class="lineno">   11</span>&#160;<span class="comment"> * The above copyright notice and this permission notice shall be included in</span></div><div class="line"><a name="l00012"></a><span class="lineno">   12</span>&#160;<span class="comment"> * all copies or substantial portions of the Software.</span></div><div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="comment"> * THE SOFTWARE IS PROVIDED &quot;AS IS&quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR</span></div><div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160;<span class="comment"> * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,</span></div><div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="comment"> * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL</span></div><div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;<span class="comment"> * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER</span></div><div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;<span class="comment"> * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING</span></div><div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="comment"> * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER</span></div><div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="comment"> * DEALINGS IN THE SOFTWARE.</span></div><div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="tensorNet_8h.html">tensorNet.h</a>&quot;</span></div><div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;</div><div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;</div><div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#if NV_TENSORRT_MAJOR &gt;= 5</span></div><div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#define HAS_SUPERRES_NET</span></div><div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#endif</span></div><div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;</div><div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;</div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="classsuperResNet.html">   39</a></span>&#160;<span class="keyword">class </span><a class="code" href="classsuperResNet.html">superResNet</a> : <span class="keyword">public</span> <a class="code" href="classtensorNet.html">tensorNet</a></div><div class="line"><a name="l00040"></a><span class="lineno">   40</span>&#160;{</div><div class="line"><a name="l00041"></a><span class="lineno">   41</span>&#160;<span class="keyword">public</span>:</div><div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;        <span class="keyword">static</span> <a class="code" href="classsuperResNet.html">superResNet</a>* <a class="code" href="classsuperResNet.html#ac3996e45ad673ae2b31d3061ce27174f">Create</a>();</div><div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;</div><div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160;        <a class="code" href="classsuperResNet.html#a4867ff87e273b1d36605a881bc6f278c">~superResNet</a>();</div><div class="line"><a name="l00051"></a><span class="lineno">   51</span>&#160;</div><div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;        <span class="keywordtype">bool</span> <a class="code" href="classsuperResNet.html#ac1248d34fa3b0e3c08c318088ed3c9d8">UpscaleRGBA</a>( <span class="keywordtype">float</span>* input, uint32_t inputWidth, uint32_t inputHeight,</div><div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;                                <span class="keywordtype">float</span>* output, uint32_t outputWidth, uint32_t outputHeight,</div><div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;                                <span class="keywordtype">float</span> maxPixelValue=255.0f );</div><div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;        <span class="keywordtype">bool</span> <a class="code" href="classsuperResNet.html#ac1248d34fa3b0e3c08c318088ed3c9d8">UpscaleRGBA</a>( <span class="keywordtype">float</span>* input, <span class="keywordtype">float</span>* output, <span class="keywordtype">float</span> maxPixelValue=255.0f );</div><div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;</div><div class="line"><a name="l00067"></a><span class="lineno"><a class="line" href="classsuperResNet.html#a9af57ed0d9bb28a82f1cad7a43648bea">   67</a></span>&#160;        <span class="keyword">inline</span> uint32_t <a class="code" href="classsuperResNet.html#a9af57ed0d9bb28a82f1cad7a43648bea">GetInputWidth</a>()<span class="keyword"> const                                           </span>{ <span class="keywordflow">return</span> <a class="code" href="classtensorNet.html#accab52fa354232149048440da0071573">mWidth</a>; }</div><div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;</div><div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="classsuperResNet.html#a742fd684d98f9f8d3aeaf3093535f3ef">   72</a></span>&#160;        <span class="keyword">inline</span> uint32_t <a class="code" href="classsuperResNet.html#a742fd684d98f9f8d3aeaf3093535f3ef">GetInputHeight</a>()<span class="keyword"> const                                          </span>{ <span class="keywordflow">return</span> <a class="code" href="classtensorNet.html#abc0c2b349cb27ddf6e42f668fa582a34">mHeight</a>; }</div><div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;</div><div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="classsuperResNet.html#a9e1f7570a04374452a91528d665249ac">   77</a></span>&#160;        <span class="keyword">inline</span> uint32_t <a class="code" href="classsuperResNet.html#a9e1f7570a04374452a91528d665249ac">GetOutputWidth</a>()<span class="keyword"> const                                          </span>{ <span class="keywordflow">return</span> <a class="code" href="tensorNet_8h.html#a7d959cb65990da8bfea3d941d6daf416">DIMS_W</a>(<a class="code" href="classtensorNet.html#a3487d6af48f91afcbeea76552d21d1c5">mOutputs</a>[0].dims); }</div><div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;</div><div class="line"><a name="l00082"></a><span class="lineno"><a class="line" href="classsuperResNet.html#a9f115dd878ad47bb12358ec52699e7ae">   82</a></span>&#160;        <span class="keyword">inline</span> uint32_t <a class="code" href="classsuperResNet.html#a9f115dd878ad47bb12358ec52699e7ae">GetOutputHeight</a>()<span class="keyword"> const                                         </span>{ <span class="keywordflow">return</span> <a class="code" href="tensorNet_8h.html#a1fc0b1785ea99bd75ec83b1eeb4e6120">DIMS_H</a>(<a class="code" href="classtensorNet.html#a3487d6af48f91afcbeea76552d21d1c5">mOutputs</a>[0].dims); }</div><div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;</div><div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="classsuperResNet.html#a6b4472f012b65414a2e9228f8eb747b9">   87</a></span>&#160;        <span class="keyword">inline</span> uint32_t <a class="code" href="classsuperResNet.html#a6b4472f012b65414a2e9228f8eb747b9">GetScaleFactor</a>()<span class="keyword"> const                                          </span>{ <span class="keywordflow">return</span> <a class="code" href="classsuperResNet.html#a9e1f7570a04374452a91528d665249ac">GetOutputWidth</a>() / <a class="code" href="classsuperResNet.html#a9af57ed0d9bb28a82f1cad7a43648bea">GetInputWidth</a>(); }</div><div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;</div><div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;<span class="keyword">protected</span>:</div><div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;        <a class="code" href="classsuperResNet.html#a55e12611e1b5102def860ba93b3bb54c">superResNet</a>();</div><div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;};</div><div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;</div><div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160;</div><div class="ttc" id="classsuperResNet_html_a742fd684d98f9f8d3aeaf3093535f3ef"><div class="ttname"><a href="classsuperResNet.html#a742fd684d98f9f8d3aeaf3093535f3ef">superResNet::GetInputHeight</a></div><div class="ttdeci">uint32_t GetInputHeight() const</div><div class="ttdoc">Retrieve the height of the input image, in pixels. </div><div class="ttdef"><b>Definition:</b> superResNet.h:72</div></div>
<div class="ttc" id="tensorNet_8h_html_a7d959cb65990da8bfea3d941d6daf416"><div class="ttname"><a href="tensorNet_8h.html#a7d959cb65990da8bfea3d941d6daf416">DIMS_W</a></div><div class="ttdeci">#define DIMS_W(x)</div><div class="ttdef"><b>Definition:</b> tensorNet.h:52</div></div>
<div class="ttc" id="classsuperResNet_html_a9af57ed0d9bb28a82f1cad7a43648bea"><div class="ttname"><a href="classsuperResNet.html#a9af57ed0d9bb28a82f1cad7a43648bea">superResNet::GetInputWidth</a></div><div class="ttdeci">uint32_t GetInputWidth() const</div><div class="ttdoc">Retrieve the width of the input image, in pixels. </div><div class="ttdef"><b>Definition:</b> superResNet.h:67</div></div>
<div class="ttc" id="classsuperResNet_html_a9f115dd878ad47bb12358ec52699e7ae"><div class="ttname"><a href="classsuperResNet.html#a9f115dd878ad47bb12358ec52699e7ae">superResNet::GetOutputHeight</a></div><div class="ttdeci">uint32_t GetOutputHeight() const</div><div class="ttdoc">Retrieve the height of the output image, in pixels. </div><div class="ttdef"><b>Definition:</b> superResNet.h:82</div></div>
<div class="ttc" id="classtensorNet_html_a3487d6af48f91afcbeea76552d21d1c5"><div class="ttname"><a href="classtensorNet.html#a3487d6af48f91afcbeea76552d21d1c5">tensorNet::mOutputs</a></div><div class="ttdeci">std::vector&lt; outputLayer &gt; mOutputs</div><div class="ttdef"><b>Definition:</b> tensorNet.h:556</div></div>
<div class="ttc" id="classsuperResNet_html_ac3996e45ad673ae2b31d3061ce27174f"><div class="ttname"><a href="classsuperResNet.html#ac3996e45ad673ae2b31d3061ce27174f">superResNet::Create</a></div><div class="ttdeci">static superResNet * Create()</div><div class="ttdoc">Load super resolution network. </div></div>
<div class="ttc" id="tensorNet_8h_html"><div class="ttname"><a href="tensorNet_8h.html">tensorNet.h</a></div></div>
<div class="ttc" id="classtensorNet_html_abc0c2b349cb27ddf6e42f668fa582a34"><div class="ttname"><a href="classtensorNet.html#abc0c2b349cb27ddf6e42f668fa582a34">tensorNet::mHeight</a></div><div class="ttdeci">uint32_t mHeight</div><div class="ttdef"><b>Definition:</b> tensorNet.h:533</div></div>
<div class="ttc" id="classsuperResNet_html_ac1248d34fa3b0e3c08c318088ed3c9d8"><div class="ttname"><a href="classsuperResNet.html#ac1248d34fa3b0e3c08c318088ed3c9d8">superResNet::UpscaleRGBA</a></div><div class="ttdeci">bool UpscaleRGBA(float *input, uint32_t inputWidth, uint32_t inputHeight, float *output, uint32_t outputWidth, uint32_t outputHeight, float maxPixelValue=255.0f)</div><div class="ttdoc">Upscale a 4-channel RGBA image. </div></div>
<div class="ttc" id="classsuperResNet_html_a9e1f7570a04374452a91528d665249ac"><div class="ttname"><a href="classsuperResNet.html#a9e1f7570a04374452a91528d665249ac">superResNet::GetOutputWidth</a></div><div class="ttdeci">uint32_t GetOutputWidth() const</div><div class="ttdoc">Retrieve the width of the output image, in pixels. </div><div class="ttdef"><b>Definition:</b> superResNet.h:77</div></div>
<div class="ttc" id="classtensorNet_html_accab52fa354232149048440da0071573"><div class="ttname"><a href="classtensorNet.html#accab52fa354232149048440da0071573">tensorNet::mWidth</a></div><div class="ttdeci">uint32_t mWidth</div><div class="ttdef"><b>Definition:</b> tensorNet.h:532</div></div>
<div class="ttc" id="classsuperResNet_html_a4867ff87e273b1d36605a881bc6f278c"><div class="ttname"><a href="classsuperResNet.html#a4867ff87e273b1d36605a881bc6f278c">superResNet::~superResNet</a></div><div class="ttdeci">~superResNet()</div><div class="ttdoc">Destroy. </div></div>
<div class="ttc" id="classsuperResNet_html"><div class="ttname"><a href="classsuperResNet.html">superResNet</a></div><div class="ttdoc">Super Resolution Network. </div><div class="ttdef"><b>Definition:</b> superResNet.h:39</div></div>
<div class="ttc" id="classtensorNet_html"><div class="ttname"><a href="classtensorNet.html">tensorNet</a></div><div class="ttdoc">Abstract class for loading a tensor network with TensorRT. </div><div class="ttdef"><b>Definition:</b> tensorNet.h:188</div></div>
<div class="ttc" id="classsuperResNet_html_a6b4472f012b65414a2e9228f8eb747b9"><div class="ttname"><a href="classsuperResNet.html#a6b4472f012b65414a2e9228f8eb747b9">superResNet::GetScaleFactor</a></div><div class="ttdeci">uint32_t GetScaleFactor() const</div><div class="ttdoc">Retrieve the scale factor between the input and output. </div><div class="ttdef"><b>Definition:</b> superResNet.h:87</div></div>
<div class="ttc" id="classsuperResNet_html_a55e12611e1b5102def860ba93b3bb54c"><div class="ttname"><a href="classsuperResNet.html#a55e12611e1b5102def860ba93b3bb54c">superResNet::superResNet</a></div><div class="ttdeci">superResNet()</div></div>
<div class="ttc" id="tensorNet_8h_html_a1fc0b1785ea99bd75ec83b1eeb4e6120"><div class="ttname"><a href="tensorNet_8h.html#a1fc0b1785ea99bd75ec83b1eeb4e6120">DIMS_H</a></div><div class="ttdeci">#define DIMS_H(x)</div><div class="ttdef"><b>Definition:</b> tensorNet.h:51</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_2e4d84877693cd000e5cb535f4b23486.html">jetson-inference</a></li><li class="navelem"><a class="el" href="superResNet_8h.html">superResNet.h</a></li>
    <li class="footer">Generated on Thu Sep 26 2019 12:19:11 for Jetson Inference by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li>
  </ul>
</div>
</body>
</html>
